﻿#include "Vector3D.h"
#include <cmath>

Vector3D::Vector3D(float x, float y, float z)
{
    this->m_X = x;
    this->m_Y = y;
    this->m_Z = z;
}

float Vector3D::x() const {
    return this->m_X;
}

void Vector3D::setX(float x) {
    this->m_X = x;
}

float Vector3D::y() const {
    return this->m_Y;
}

void Vector3D::setY(float y) {
    this->m_Y = y;
}

float Vector3D::z() const
{
    return m_Z;
}

void Vector3D::setZ(float z)
{
    m_Z = z;
}

bool Vector3D::sameWith(Vector3D *p, const float &precision) const
{
    return (std::abs(this->m_X - p->m_X) < precision) && (std::abs(this->m_Y - p->m_Y) < precision) && (std::abs(this->m_Z - p->m_Z) < precision);
}

